﻿/*----------------------------------------------------------------
//  <copyright file="OrganizationNodeDto.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2023-09-22 09:22</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.Identity.Dtos
{
    #region "组织机构节点DTO"
    /// <summary>
    /// 组织机构节点DTO
    /// </summary>
    [MapFrom(typeof(Organization))]
    public class OrganizationNodeDto : OrganizationOutputDto
    {
        #region "属性"
        #region "获取 层级"
        /// <summary>
        /// 获取 层级
        /// </summary>
        [DisplayName("层级")]
        public int Level { get { return TreePathString.IsMissing() ? -1 : TreePathString.Split(',').Length; } }
        #endregion

        #endregion

        #region "构造函数"
        #region "初始化一个组织机构节点DTO的新实例"
        /// <summary>
        /// 初始化一个组织机构节点DTO <see cref="OrganizationNodeDto"/> 的新实例
        /// </summary>
        public OrganizationNodeDto()
            : base()
        { }
        #endregion
        #region "初始化一个组织机构节点DTO的新实例"
        /// <summary>
        /// 初始化一个组织机构节点DTO <see cref="OrganizationNodeDto"/> 的新实例
        /// </summary>
        /// <param name="organization">组织机构实体数据</param>
        /// <param name="detail">组织机构详情实体数据</param>
        public OrganizationNodeDto(Organization organization, OrganizationDetail detail)
            : base(organization, detail)
        { }
        #endregion

        #endregion

    }
    #endregion

}
